package com.visitcqut.service.impl;

import com.visitcqut.domain.Tag;
import com.visitcqut.mapper.TagMapper;
import com.visitcqut.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;



/**
 * @program: visitcqut
 * @description: 标签服务实现类
 * @author: ATAO
 * @create: 2020-11-13 16:00
 **/


@Repository
public class TagServiceImpl implements TagService {


    /**
     * 数据库访问层
     */
    @Autowired
    TagMapper tagMapper;


    /**
     * 添加标签
     * @param data
     * @return int
     */
    @Override
    public int insert(Tag data) {
        return tagMapper.insert(data);
    }


    /**
     * 删除标签
     * @param id
     * @return int
     */
    @Override
    public int delete(Integer id) {
        return tagMapper.delete(id);
    }



    /**
     * 更新标签信息
     * @param data
     * @return int
     */
    @Override
    public int update(Tag data) {
        return tagMapper.update(data);
    }


    /**
     * 根据ｉｄ查找标签
     * @param id
     * @return Tag
     */
    @Override
    public Tag findById(Integer id) {
        return tagMapper.findById(id);
    }


    /**
     * 查找所有标签
     * @return :list<Tag>
     */
    @Override
    public List<Tag> findAll() {
        return tagMapper.findAll();
    }
}
